﻿using MVC.OA.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace MVC.OA.DALFactory
{
   public class DbSessionFactory
    {
       public static IDbSession GetCurrentDbSession()
       {
           IDbSession db = CallContext.GetData("DbSession") as IDbSession;
           if (db == null)
           {
               db = new DbSession();
               CallContext.SetData("DbSession", db);
           }
           return db;
       }
    }
}
